/*
 *------------------------------------------------------------------------------
 * @File      :    os_mem.h
 * @Date      :    2021-3-20
 * @Author    :    lomboswer <lomboswer@lombotech.com>
 * @Brief     :    Media Interface for MDP(Media Development Platform).
 *
 * Copyright (C) 2020-2021, LomboTech Co.Ltd. All rights reserved.
 *------------------------------------------------------------------------------
 */
#ifndef _OS_MEM_H
#define _OS_MEM_H

#include "os_mem_comm.h"

/*
 * APIs
 */
extern os_hdl os_mem_block_alloc(const char* name, unsigned long size,
			unsigned long align, unsigned long gfp);
unsigned long os_mem_block_phys(os_hdl hdl);
void os_mem_block_free(os_hdl hdl);
void os_mem_block_free_by_phys(unsigned long phys_addr);

void *os_mem_block_map_kernel_cache(os_hdl hdl);
void *os_mem_block_map_kernel_noncache(os_hdl hdl);
void os_mem_block_unmap_kernel(os_hdl hdl);
void os_mem_unmap_kernel(void *kvrit_addr);

void *os_mem_map_kernel_cache(unsigned long phys_addr, int nbytes);
void *os_mem_map_kernel_noncache(unsigned long phys_addr, int nbytes);
int os_mem_flush_dcache(void *kvirt_addr, unsigned long phys_addr, int nbytes);
int os_mem_invalid_dcache(void *kvirt_addr, unsigned long phys_addr, int nbytes);
void os_mem_get_usr_memstats(struct mem_stats_info *pmem_stats);
#endif
